<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<div class="right_content">
        <h2 style="margin-top:0px">Product Management</h2>
	<s:if test="%{#request.error != null}">
		<div style="color: #f00;">
			<s:property value="#request.error" />
		</div>
		<br />
	</s:if>
	<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
          <thead>
            <tr>
              <th scope="col" class="rounded">N.O</th>
              <th scope="col" class="rounded">Name</th>
              <th scope="col" class="rounded">Model</th>
              <th scope="col" class="rounded">SKU</th>
              <th scope="col" class="rounded" width="8%">Price</th>
              <th scope="col" class="rounded">Available</th>
              <th scope="col" class="rounded">Edit</th>
              <th scope="col" class="rounded-q4">Delete</th>
            </tr>
          </thead>
          <tfoot>
          </tfoot>
          <tbody style="text-align: center">
          
          <s:iterator status="product" value="#request.products">
          	<tr>
              <td><s:property value="#product.index" /></td>
              <td><s:property value="getName()" /></td>
              <td><s:property value="getModel()" /></td>
              <td><s:property value="getSku()" /></td>
              <td><s:property value="getPrice()" /> $</td>
              <td>
              	<s:if test="%{isAvailable() == true}">
              		<input type="checkbox" checked="checked" disabled="disabled"/>
              	</s:if>
              	<s:else>
              		<input type="checkbox" disabled="disabled"/>
              	</s:else>
              		
              </td>
              <td><a href=" <s:url action="productlist"> <s:param name="action">edit</s:param><s:param name="sku" value="getSku()" /></s:url>"><img src="<s:url value="/css/admin/images/user_edit.png"/>" alt="" title="" border="0" /></a></td>
              <td><a href="#" class="ask"><img src="<s:url value="/css/admin/images/trash.png"/>" alt="<s:property value="getSku()" />" 
              title="" border="0" onclick="confirmDelete('/productlist?action=delete&sku=' + this.alt)" /></a></td>
            </tr>
            
          </s:iterator>
          </tbody>
        </table>
        <div class="pagination">
			<span class="disabled"><< prev</span>
			<span class="current">1</span>
			<span class="disabled">next >></span>
		</div>
        <h2>&nbsp;</h2>
      </div>